module.exports = {
    buttons: [
      {
        text: '添加',
        type: 'danger',
        handler: 'funcString: { tableContext: { setAddFormVisiable } } #---# setAddFormVisiable(true)'
      },
      {
        text: '全选',
        handler: 'funcString: {tableContext:{tableRef}} #---# tableRef.value.toggleAllSelection()'
      },
      {
        text: '删除',
        handler: 'funcRef: removeMulti'
      }
    ],
    queryForm: {
      content: '测试内容111',
      config: {
        inline: true
      },
      rules: {
     
      },
      items: [
        { label: '类型名称', prop: 'tpName', size: 'small' },
        { label: '类型编号', prop: 'tpId', type: 'number' },
        {
          label: '性别',
          prop: 'sex',
          type: 'radio',
          style: { width: '150px' },
          options: [
            { label: '男', value: 'man' },
            { label: '女', value: 'woman' }
          ]
        },
        {
          label: '爱好',
          prop: 'loves',
          type: 'checkbox',
          options: [
            { label: '摄影', value: 'sheying' },
            { label: '电影', value: 'dianying' }
          ]
        }
      ],
      defaultValue: {},
      buttons: [
        {
          text: '确定',
          emitName: 'confirm',
          type: 'primary',
          handler: `funcString:
          { model, formRef } #---#
          {
            formRef.value.validate(function (isValid, fieldError) {
              if (!isValid) {
                console.error(fieldError)
              }
            })
          }
          `
        },
        {
          text: '取消',
          emitName: 'cancle',
          type: 'warning',
          handler: `funcString: { formRef } #---# {
            formRef.value.resetFields()
          }`
        }
      ]
    },
    addForm: {
      title: `添加人口`,
      beforeClose :`funcString: done #---# {
        done()
      }`,
      dialogConfig: {
        width: '500px',
        draggable: true
      },
      formConfig: {
        items: [
          { label: '姓名', prop: 'name', size: 'small' },
          { label: '年龄', prop: 'age', type: 'number' },
          {
            label: '性别',
            prop: 'sex',
            type: 'radio',
            style: { width: '150px' },
            options: [
              { label: '男', value: 'man' },
              { label: '女', value: 'woman' }
            ]
          },
          {
            label: '爱好',
            prop: 'loves',
            type: 'checkbox',
            options: [
              { label: '摄影', value: 'sheying' },
              { label: '电影', value: 'dianying' }
            ]
          }
        ],
        rules:{
  
        },
        defaultValue: {
         
        },
        buttons: [
          {
            text: '确定',
            emitName: 'confirm',
            type: 'primary',
            handler: `funcString: { model,formRef } #---# {
                formRef.value.validate(function (isValid, fieldError) {
                  if (!isValid) {
                    console.error(fieldError)
                  }
                })
              }`
          },
          {
            text: '取消',
            emitName: 'cancle',
            type: 'warning',
            handler: `funcString: { formRef, tableContext: { setAddFormVisiable } } #---# {
                setAddFormVisiable(false)
              }`
          },
          {
            text: '重置',
            type: 'info',
            handler: `funcString: { formRef } #---# {
                formRef.value.resetFields()
              }`
          }
        ]
      }
    },
    editForm: {
      title: '编辑信息',
      dialogConfig: {
        width: '500px'
      }
    },
    table: {
      stripe: true,
      size: 'small',
      selection: true,
      actionColumn: {
        width: 300,
        label: '操作列'
      },
      columns: [
        { prop: 'tp_id', label: '类型编号', width: '100' },
        {
          prop: 'tp_name',
          label: '类型名称',
          width: '200',
          link: 'funcString: { tp_name } #---# return `/Home?name=${tp_name}`'
        },
        {
          prop: 'tp_code',
          label: '类型编号',
          width: '200',
          filter: "funcString: row #---# prop #---# return `${row['tp_id']}--${row[prop]}`"
        },
        {
          prop: 'base_type',
          label: '基本类型',
          width: '250',
          tag: "funcString: row #---# prop #---# return ({ type: 'success', text: row['base_type'] })"
        },
        { prop: 'default_value', label: '默认值', width: '250' }
      ],
      buttons: [
        {
          text: '添加',
          type: 'primary',
          handler: `funcString: { setAddFormVisiable } #---# {
            setAddFormVisiable(true)
          }`
        },
        { text: '编辑', handler: `funcRef: openEditForm` },
        { text: '删除', handler: "funcRef: removeSingle" }
      ],
      pagin: {
        init: {
          currentPage: 1,
          pageSizes: [10, 20, 30, 40],
          pageSize: 10,
          total: 0
        },
        layout: 'total, sizes, prev, pager, next, jumper',
        prevText: '上一页',
        nextText: '下一页'
      }
    },
    handlers: {
      onMounted: `funcRef: queryPage`,
      onPaginChange: `funcRef: onPaginChange`
    }
  }
  